import { View, Text, Image } from "@tarojs/components";
import { AtTag } from "taro-ui";

import cart from "../../../../image/cart.png";
import { ImageUrl } from "../../../../utils/request";

import "./index.scss";
export default (props: any) => {
  return (
    <View className="goods_wrapper">
      {/* 标题 */}
      <View className="goods_title">
        <Text style={{ color: "black", fontWeight: 550, fontSize: 17 }}>
          沃尔玛（桃园北路）
        </Text>
        <AtTag type="primary">商家自配</AtTag>
      </View>
      {/* 商品 */}
      {props.list &&
        props.list.map(item => {
          return (
            <View className="item_wrapper">
              <View className="ImageWrapper">
                <View
                  style={{ width: "100%", height: "100%", display: "flex" }}
                >
                  <Image
                    className="ImageStype"
                    src={ImageUrl + item.picture}
                  ></Image>
                </View>
              </View>
              <View className="ItemWrapper">
                <Text className="ItemTitle">{item.goodsName}</Text>
                <Text
                  style={{ fontSize: 11, display: "block", margin: "3px 0" }}
                >
                  数量 {item.num}
                </Text>
                <Text className="ItemPrice">￥{item.price}</Text>
              </View>
            </View>
          );
        })}

      {/* 打包费 配送费 */}
      <View className="price_wrapper">
        <View className="packing_charges">
          <Text>打包费</Text>
          <Text>￥1</Text>
        </View>
        <View className="packing_charges">
          <Text>配送费</Text>
          <Text>￥6</Text>
        </View>
      </View>
      {/* 最后的价钱 */}
      <View className="all_price_wrapper">
        <View></View>
        <View style={{ marginBottom: 10 }}>小计:￥{props.allPrice}</View>
      </View>
    </View>
  );
};
